<template>
  <div class="app">
    <button @click="isShow = !isShow">显示/隐藏</button>
    <transition
      name="pengfan"
      mode="out-in"
      appear
      enter-active-class="animate__animated animate__bounce"
      leave-active-class="animate__animated animate__flipInY"
    >
      <h2 class="title" v-if="isShow">Hello World</h2>
    </transition>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isShow: true,
    };
  },
};
</script>

<style scoped>
.title {
  display: inline-block;
}
.animate__flipInY {
  animation-direction: reverse;
}
/* .pengfan-enter-active {
  animation: bounceInUp 1s ease;
}
.pengfan-leave-active {
  animation: bounceInUp 1s ease reverse;
} */
</style>